<include file="common:__head__"/>
<div class="permissions-tabs">
        <a class="role <if condition="$state eq ''">tabs-bg</if>" href="{:U('Good/index')}">全部</a>
        <a class="role <if condition="$state eq 'is_sale'">tabs-bg</if>" href="{:U('Good/index',array('state'=>is_sale))}">出售中</a>
        <a class="role <if condition="$state eq 'no_sale'">tabs-bg</if>" " href="{:U('Good/index',array('state'=>no_sale))}">已下架</a>
        <a class="role <if condition="$state eq 'zero'">tabs-bg</if>" " href="{:U('Good/index',array('state'=>zero))}">已售馨</a>
        <a class="role <if condition="$state eq 'no'">tabs-bg</if>" href='{:U('Good/index',array('state'=>no))} '>已违规</a>

</div>
<div class="permissions-content">
    <div class="permissions-le">
        <div class="add-msg">
            <a class="add-role" href="{:U('Good/addGood')}">新增商品+</a>
            <div class="add-form">
                <form method="get" action="">

                    <input type="hidden" name="m" value="seller"/>
                    <input type="hidden" name="c" value="Good"/>
                    <input type="hidden" name="a" value="index"/>
                    <input type="hidden" name="state" value="{$state}"/>

                    <select name="cate_id" id="cat_id" >
                        <option value="">所有分类</option>
                        <volist name="categories" id="category">
                            <option value="{$category['id']}"  <if condition="$category['id'] eq $cate_id">selected</if> >
                                {$category['c_name']}
                            </option>
                        </volist>
                    </select>

                    <select name="brand_id" id="brand_id" class="select">
                        <option value="">所有品牌</option>
                        <volist name="brands" id="brand">
                            <option value="{$brand['id']}" <if condition="$brand['id'] eq $brand_id">selected</if> >{$brand['b_name']}</option>
                        </volist>
                    </select>

                    <select name="shelves" id="shelves" class="select">
                        <option value="">上下架</option>
                        <option value="1" <if condition="$shelves eq 1">selected</if>>上架</option>
                        <option value="-1" <if condition="$shelves eq -1">selected</if>>下架</option>
                    </select>

                    <select name="intro" class="select" id="intro">
                        <option value="">热卖/推荐</option>
                        <option value="hot" <if condition="$intro eq 'hot'">selected</if>>热卖</option>
                        <option value="recommend" <if condition="$intro eq 'recommend'">selected</if>>推荐</option>
                    </select>


                    <div class="add-ipt">
                        <input placeholder="商品名称..." type="text" name="g_name" class="add-name" value="<if condition="$good_name neq '' ">{$good_name}</if>" />
                        <button type="submit"></button>
                    </div>
                </form>
            </div>
        </div>
        <div class="permissions-table">
            <table border="0" width="100%">
                <thead>
                <tr>
                    <td>ID</td>
                    <td>主图</td>
                    <td width="15%">商品名称</td>
                    <td>货号</td>
                    <td>库存（件）</td>
                    <td>品牌</td>
                    <td>分类</td>
                    <td>价格</td>
                    <td>推荐</td>
                    <td>热卖</td>
                    <td>包邮</td>
                    <td>上架</td>
                    <td>操作</td>
                </tr>
                </thead>
                <tbody>
                <volist name="goods" id="good" key="k">
                    <tr>
                        <td>{$good.id}</td>
                        <td>
                            <if condition="$good['img'] neq ''">
                                <a href="{$good.img}" target="_blank">
                                    <img width="40" height="30" src="{$good.img}"/>
                                </a>
                            <else />
                                <a href="./Uploads/good/no.png" target="_blank">
                                    <img width="40" height="30" src="./Uploads/good/no.png"/>
                                </a>
                            </if>
                        </td>
                        <td>{$good.g_name}</td>
                        <td>{$good.good_sn}</td>
                        <td>{$good.stock}</td>
                        <td>{$good.b_name}</td>
                        <td>{$good.c_name}</td>
                        <td>{$good.price}</td>
                        <td>
                            <if condition='$good[recommend] eq 1'>
                                <span class="yes" onClick="changeGoodsVal2('good','id','{$good.id}','recommend',this)" ><i class="fa fa-check-circle"></i>是</span>
                                <else />
                                <span class="no" onClick="changeGoodsVal2('good','id','{$good.id}','recommend',this)" ><i class="fa fa-ban"></i>否</span>
                            </if>
                        </td>

                        <td>
                            <if condition='$good[hot] eq 1'>
                                <span class="yes" onClick="changeGoodsVal2('good','id','{$good.id}','hot',this)" ><i class="fa fa-check-circle"></i>是</span>
                                <else />
                                <span class="no" onClick="changeGoodsVal2('good','id','{$good.id}','hot',this)" ><i class="fa fa-ban"></i>否</span>
                            </if>
                        </td>

                        <td>
                            <if condition='$good[is_free] eq 1'>
                                <span class="yes" onClick="changeGoodsVal2('good','id','{$good.id}','is_free',this)" ><i class="fa fa-check-circle"></i>是</span>
                                <else />
                                <span class="no" onClick="changeGoodsVal2('good','id','{$good.id}','is_free',this)" ><i class="fa fa-ban"></i>否</span>
                            </if>
                        </td>

                        <td>
                            <if condition='$good[shelves] eq 1'>
                                <span class="yes" onClick="changeGoodsVal2('good','id','{$good.id}','shelves',this)" ><i class="fa fa-check-circle"></i>是</span>
                                <else />
                                <span class="no" onClick="changeGoodsVal2('good','id','{$good.id}','shelves',this)" ><i class="fa fa-ban"></i>否</span>
                            </if>
                        </td>

                        <td>
                            <a href="{:U('Good/edit', array('id'=> $good['id']))}" class="btn btn-blue">编辑</a>
                            <if condition="$good['agent_brand'] eq 1">
                                <a href="{:U('Good/price', array('id'=>$good['id']))}" class="btn btn-green">代理价</a>
                            </if>
                            <if condition="$good['end_shelves'] eq -1">
                                <a href="{:U('Good/appeal', array('id'=>$good['id']))}" class="btn btn-red">申诉</a>
                            </if>
                        </td>
                    </tr>
                </volist>
                </tbody>
            </table>
            {$page}
        </div>
    </div>
    <div class="permissions-ri">
        <a href="" class="permissions-help">帮助和服务</a>
    </div>

</div>
<include file="common:__foot__"/>